home *** CD-ROM | disk | FTP | other *** search
- /*
- ==============================================================================
- WordUp Graphics Toolkit Version 5.0
- Demonstration Program 1
-
- Simply starts the graphics mode (320x200x256), draws a line, gets a key,
- returns to text mode, and exits.
-
- Uses wgetmode and wsetmode to save and restore the video mode used before
- running this program.
-
- *** PROJECT ***
- This program requires the file WGT5_WC.LIB to be linked.
-
- *** DATA FILES ***
- NONE
- WATCOM C++ VERSION
- ==============================================================================
- */
-
- #include <wgt5.h>
-
-
- void main(void)
- {
- short oldmode;
-
- printf ("WGT Example #1\n\n");
- printf ("This program will draw a single white diagonal line across the\n");
- printf ("screen and wait for a keypress.\n");
- printf ("\n\nPress any key to continue.\n");
- getch ();
-
- if ( !vgadetected() )
- {
- printf("Error - VGA card required for any WGT program.\n");
- exit(0);
- }
-
- oldmode = wgetmode(); /* Gets the current mode */
- vga256(); /* Initializes WGT system */
-
- wsetcolor(15);
- wline(0,0,319,199); /* Draw a line */
- getch();
- wsetmode(oldmode); /* Restore old video mode */
- }
-